package com.hudson.admin.controller;

import com.hudson.admin.client.BrokerClientManege;
import com.hudson.admin.domain.Result;
import com.hudson.admin.util.Results;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @Author: 渔小鲤
 * @DateTime: 2025/7/27 0:16
 **/
@RestController
@RequestMapping("/broker")
public class BrokerController {
    @Resource
    private BrokerClientManege brokerClientManege;

    @GetMapping("/topic-info")
    public Result<Map<String, Integer>> getTopicQueue(@RequestParam("brokerName") String brokerName){
        Map<String, Integer> topicMap = brokerClientManege.getTopicMap(brokerName);

        return Results.success(topicMap);
    }
}
